package org.lyl.taobao.service;

import org.lyl.taobao.api.IOrderService;
import org.lyl.taobao.api.entity.Order;
import org.lyl.taobao.api.utils.DruidConnectionUtils;
import org.lyl.taobao.dao.IOrderDao;
import org.lyl.taobao.dao.impl.OrderDaoImpl;

import java.sql.Connection;
import java.util.List;

/**
 * @Author: Re
 * @Date: 2021/4/9 20:47
 */
public class OrderServiceImpl implements IOrderService {
    DruidConnectionUtils druidConnectionUtils=new DruidConnectionUtils();
    IOrderDao iOrderDao = new OrderDaoImpl();
    public boolean addOrder(Order order) {
        return iOrderDao.addOrder(druidConnectionUtils.getConnection(),order);
    }

    public List<Order> checkOrder(Integer userId) {
        return iOrderDao.checkOrder(druidConnectionUtils.getConnection(),userId);
    }

    public boolean deleteOrder(Integer orderId) {
        return iOrderDao.deleteOrder(druidConnectionUtils.getConnection(),orderId);
    }
}
